To understand how to convert to the ones' complement (inverse) and the two's complement representation, let's go through the general steps for both:

Ones' Complement (Inverse):

1. Convert to Binary:
   - Represent the decimal number in binary form.

2. Invert Bits:
   - Replace each '0' with '1' and each '1' with '0' to obtain the ones' complement.

3. Result:
   - The obtained binary is the ones' complement representation.

Two's Complement:

1. Convert to Binary:
   - Represent the decimal number in binary form.

2. Invert Bits (Same as Ones' Complement):
   - Replace each '0' with '1' and each '1' with '0' to obtain the ones' complement.

3. Add 1:
   - Add 1 to the obtained ones' complement binary.

4. Result:
   - The final binary is the two's complement representation.

Here's an example for better clarity:

Example:
Let's convert the decimal number -5 to ones' complement and two's complement.

1. Convert to Binary:
   - Decimal -5 in 4-bit binary: 1011

2. Ones' Complement (Inverse):
   - Invert Bits: 0100

3. Two's Complement:
   - Invert Bits: 0100
   - Add 1: 0100 + 1 = 0101

Result:
   - Ones' Complement: 0100
   - Two's Complement: 0101

In summary, ones' complement is obtained by inverting the bits, while two's complement is obtained by inverting the bits and adding 1 to the result. These representations are commonly used in computer arithmetic for signed integers.